<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico"/>
    <link rel="stylesheet" href="/Y-Admin/layui/css/layui.css">
    <link rel="stylesheet" href="/Y-Admin/css/common.css">
    <link rel="stylesheet" href="/Y-Admin/layui/extend/dtree.css">
    <link rel="stylesheet" href="/Y-Admin/layui/extend/font/dtreefont.css">
    <link rel="stylesheet" href="/Y-Admin/layui/extend/formSelects-v4.css">

    <style>
        .content {
            padding: 15px;
        }

        i {
            margin-right: 10px;
        }

        .item {
            margin-bottom: 15px;
            box-shadow: 1px 1px 5px 3px #eeeeee;
        }

        .layui-card-body {
            border-bottom: 1px solid #dcdada;
        }

        .exe-1 {
            margin-right: 20px;
            display: inline-block;
        }

        .w-e-text-container {
            height: 300px !important; /*!important是重点，因为原div是行内样式设置的高度300px*/
        }

        blockquote {
            display: block;
            border-left: 8px solid #d0e5f2;
            padding: 5px 10px;
            margin: 10px 0;
            line-height: 1.4;
            font-size: 100%;
            background-color: #f1f1f1;
        }

        .layui-bg-gray {
            padding: 2px 8px;
            margin-right: 20px;
        }
    </style>
</head>
<body>
<div class="yadmin-body animated fadeIn">
    <div class="layui-col-md12" style="margin-bottom: 15px">
        <span class="layui-badge layui-bg-green" style="margin-bottom: 5px">
            问卷标题：${questionnaire.title}
        </span>
        <span class="layui-badge layui-bg-green" style="margin-bottom: 5px">
            发布时间：<fmt:formatDate value="${questionnaire.creatTime}" pattern="yyyy-MM-dd HH:mm:ss"/>
        </span>
        <span class="layui-badge" style="margin-bottom: 5px">
            参与者：${u.name}
        </span>
        <span class="layui-badge" style="margin-bottom: 5px">
            联系电话：${u.cellphone}
        </span>
    </div>
    <div class="layui-col-md12 layui-form">
        <div class="layui-col-md12">
            <c:forEach items="${userQuestionnaireList}" var="item" varStatus="xh">
                <div class="layui-card item" style="background-color: #ffffff">
                    <div class="layui-card-header" style="position: relative">
                        <span class="layui-badge layui-bg-gray"># ${xh.count}</span>
                    </div>
                    <div class="layui-card-body">
                            ${item.question.questionStem}
                    </div>
                    <div>
                        <div class="layui-form-item">
                            <div class="layui-input-block" style="margin-left: 10px">
                                <c:if test="${item.answer == 'A'}">
                                    <input type="radio" title="A. ${item.question.optionA}" checked>
                                    <input type="radio" title="B. ${item.question.optionB}">
                                    <input type="radio" title="C. ${item.question.optionC}">
                                    <input type="radio" title="D. ${item.question.optionD}">
                                </c:if>

                                <c:if test="${item.answer == 'B'}">
                                    <input type="radio" title="A. ${item.question.optionA}">
                                    <input type="radio" title="B. ${item.question.optionB}" checked>
                                    <input type="radio" title="C. ${item.question.optionC}">
                                    <input type="radio" title="D. ${item.question.optionD}">
                                </c:if>

                                <c:if test="${item.answer == 'C'}">
                                    <input type="radio" title="A. ${item.question.optionA}">
                                    <input type="radio" title="B. ${item.question.optionB}">
                                    <input type="radio" title="C. ${item.question.optionC}" checked>
                                    <input type="radio" title="D. ${item.question.optionD}">
                                </c:if>
                                <c:if test="${item.answer == 'D'}">
                                    <input type="radio" title="A. ${item.question.optionA}">
                                    <input type="radio" title="B. ${item.question.optionB}">
                                    <input type="radio" title="C. ${item.question.optionC}">
                                    <input type="radio" title="D. ${item.question.optionD}" checked>
                                </c:if>
                            </div>
                        </div>
                    </div>
                </div>
            </c:forEach>
        </div>
    </div>
</div>

<script src="/js/jquery-3.3.1.min.js" charset="utf-8"></script>
<script src="/js/ajax.js" charset="utf-8"></script>
<script src="/Y-Admin/layui/layui.js"></script>
<script src="/Y-Admin/js/common.js"></script>
<script type="text/javascript" src="/wangEditor/release/wangEditor.js"></script>

<script>
    layui.config({
        base: '/Y-Admin/layui/extend/'
    }).extend({
        formSelects: 'formSelects-v4'
    }).use(['form', 'layer', 'formSelects', 'dtree', 'upload'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer
            , formSelects = layui.formSelects
            , dtree = layui.dtree
            , upload = layui.upload;

        form.render('radio');

    });
</script>

</body>
</html>